package com.epalmpay.job;

import com.epalmpay.service.bonus.IBonusService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import com.epalmpay.util.Logger;

///积分入账Job
@Component
public class BonusAccountedJob {

	protected Logger logger = Logger.getLogger(this.getClass());

	@Resource
	private IBonusService bonusService;

	/**
	 * 每45分钟执行一次
	 */
	@Scheduled(cron="0 0/45 * * * ?")
	public void bonusAutoAccounted(){
		logger.info("====BonusAccountedJob===============================================================");
    	logger.info("进行执行  积分入账Job");

		try {
			bonusService.insertMemberBonus();
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
		}

		logger.info("=======================================BonusAccountedJob end=============================");
	}
}
